package com.t3rik.mes.emp.domain;

import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.t3rik.common.annotation.Excel;
import com.t3rik.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;

/**
* 工资总表对象 emp_salary
*
* @author ykh
* @date 2025-02-19
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "emp_salary")
public class EmpSalary extends BaseEntity
{
    @Serial
    private static final long serialVersionUID = 1L;

    /** 主键，自增 */
    @Excel(name = "主键")
    @TableId
    private Long id;


    /** 年度 */
    @JsonFormat(pattern = "yyyy")
    @Excel(name = "年度", width = 30, dateFormat = "yyyy")
    private String year;


    /** 报工人id */
    @Excel(name = "报工人id")
    private Long userId;


    /** 报工用户名 */
    @Excel(name = "报工用户名")
    private String userName;


    /** 计件总工资（不含奖励）zi */
    @Excel(name = "计件总工资（不含奖励）")
    private BigDecimal totalCountPrice;


    /** 计件总工资（含奖励） */
    @Excel(name = "计件总工资（含奖励）")
    private BigDecimal totalPrice;


    /** 白班工资 */
    @Excel(name = "白班工资")
    private BigDecimal dayPrice;


    /** 夜班工资 */
    @Excel(name = "夜班工资")
    private BigDecimal nightPrice;


    /** 最终工资 */
    @Excel(name = "最终工资")
    private BigDecimal finalPrice;


    /** 已结算工资 */
    @Excel(name = "已结算工资")
    private BigDecimal settledPrice;


    /** 未结算工资 */
    @Excel(name = "未结算工资")
    private BigDecimal unsettledPrice;


    /** 上次结算时间 */
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ii")
    @Excel(name = "上次结算时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private String lastSettledTime;


    /** 结算状态 */
    @Excel(name = "结算状态")
    private Integer settlementStatus;


    /** 逻辑删除字段 0:未删除 1:已删除 */
    private Long deleted;


    /** 逻辑删除辅助字段 */
    private Date deleteAt;


    /** 修改人id */
    private Long updateUserId;


    /** 创建人id */
    private Long createUserId;

    //结算装填枚举
    @Getter
    public enum SettlementStatusEnum {
        /**
         * 未结算
         */
        UNSETTLED(0, "未结算"),
        /**
         * 部分结算
         */
        PART_SETTLED(1, "部分结算"),

        SETTLED(2, "已结算");

        private final Integer code;
        private final String message;

        SettlementStatusEnum(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

    }

}
